package belf.migrate.api.type;

public enum VerifyTableType {

    OK("ok", "一致"),

    TABLE_NOT_EXIST("table_not_exist", "表不存在"),

    TABLE_DATA_ERROR("table_data_error", "获取table数据失败"),

    TABLE_SIZE_ERROR("table_size_error", "表数量不一致"),

    ROW_SIZE_ERROR("row_size_error", "行数不一致"),

    COLUMN_SIZE_ERROR("column_size_error", "列数不一致"),

    DATA_MATCH_ERROR("data_match_error", "数据不一致"),

    COLUMN_MATCH_ERROR("column_match_error", "列不一致"),

    COLUMN_TYPE_MATCH_ERROR("column_type_match_error", "列类型不一致"),

    COLUMN_COMMENT_MATCH_ERROR("column_comment_match_error", "列注释不一致");

    private String type;

    private String desc;

    VerifyTableType(String type, String desc)
    {
        this.type = type;
        this.desc = desc;
    }
    public String getType()
    {
        return type;
    }
    public String getDesc()
    {
        return desc;
    }


    public static VerifyTableType getByType(String type)
    {
        for (VerifyTableType value : VerifyTableType.values())
        {
            if (value.getType().equals(type))
            {
                return value;
            }
        }
        return null;
    }
}
